import { message } from 'ant-design-vue';
import { useMessage } from './useMessage';
import { h } from 'vue'
const { createConfirm,createMessage } = useMessage();
// 全局删除询问框
export const delConfirm = (callback,params,refresh) => createConfirm({
  iconType: 'warning',
  title: () => h('span', '温馨提醒'),
  content: () => h('span', '是否确认删除？'),
  onOk: () => {
    callback(params).then((res) => {
      if (res.code == 200) {
        createMessage.success('删除成功！');
        refresh()
      } else {
        createMessage.error(res.message);
      }
    })
  }
});